import { ref } from 'vue'

export default () => {
    let myApi: any = ref('')
    const goSetting = () => {
        const obj = {
            url: '/setting',
            name: 'setWindow',
            title: '设置'
        }
        myApi.value.newOpen(obj)
    }
    const goMoHu = () => {
        const obj = {
            url: '/mohu',
            name: 'mohuWindow',
            title: '萌虎壁纸'
        }
        myApi.value.newOpen(obj)
    }
    const goSearch = () => {
        const obj = {
            url: '/search',
            name: 'searchWindow',
            title: '搜索'
        }
        myApi.value.newOpen(obj)
    }
    const goMobileImg = () => {
        const obj = {
            url: '/mobileImg',
            name: 'mobileImgWindow',
            title: '手机壁纸'
        }
        myApi.value.newOpen(obj)
    }
    const go360Img = () => {
        const obj = {
            url: '/Img360',
            name: '360ImgWindow',
            title: '360壁纸'
        }
        myApi.value.newOpen(obj)
    }
    const goPexels = () => {
        const obj = {
            url: '/pexels',
            name: 'pexelsWindow',
            title: 'Pexels'
        }
        myApi.value.newOpen(obj)
    }
    const goBing = () => {
        const obj = {
            url: '/bing',
            name: 'bingWindow',
            title: 'Bing每日壁纸'
        }
        myApi.value.newOpen(obj)
    }
    const goImg4K = () => {
        const obj = {
            url: '/img4K',
            name: 'img4KWindow',
            title: '4K壁纸'
        }
        myApi.value.newOpen(obj)
    }
    const goMoeImg = () => {
        const obj = {
            url: '/moeImg',
            name: 'moeImgWindow',
            title: '萌える嘘'
        }
        myApi.value.newOpen(obj)
    }
    return {
        myApi,
        goSetting,
        goMoHu,
        goSearch,
        goMobileImg,
        go360Img,
        goPexels,
        goBing,
        goImg4K,
        goMoeImg
    }
}